package com.venutech.gongan.dto.rpc.common;

public enum OpRepairStatusType {

    INCORRECT_REPORT("900302012", "误报"),
    WAITING_ALLOCATION("900302015", "待分流"),
    WAITING_RESPONSE("900302020", "待响应"),
    REPAIRING("900302030", "正在维修"),
    WAITING_CONFIRMATION("900302060", "待确认"),
    WAITING_CONFIRMATION_2("900302065", "待确认"),
    DOUBLE_CHECK_FAILED("900302070", "复检未通过"),
    DOUBLE_CHECK_APPEAL("900302075", "复检申诉"),
    REPAIR_COMPLETE("900302080", "维修完成"),
    OTHER_STATUS("000000000", "其他状态");

    private String value;

    private String name;

    OpRepairStatusType(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public static String getNameByValue(String value) {
        for (OpRepairStatusType item : OpRepairStatusType.values()) {
            if (item.getValue().equals(value)) {
                return item.getName();
            }
        }
        return "";
    }

    public static OpRepairStatusType getOpRepairStatusTypeByValue(String value) {
        OpRepairStatusType repairStatusType = OpRepairStatusType.OTHER_STATUS;
        if (value.equals(OpRepairStatusType.INCORRECT_REPORT.getValue())) {
            repairStatusType = OpRepairStatusType.INCORRECT_REPORT;
        } else if (value.equals(OpRepairStatusType.WAITING_ALLOCATION.getValue())) {
            repairStatusType = OpRepairStatusType.WAITING_ALLOCATION;
        } else if (value.equals(OpRepairStatusType.WAITING_RESPONSE.getValue())) {
            repairStatusType = OpRepairStatusType.WAITING_RESPONSE;
        } else if(value.equals(OpRepairStatusType.REPAIRING.getValue())) {
            repairStatusType = OpRepairStatusType.REPAIRING;
        } else if(value.equals(OpRepairStatusType.WAITING_CONFIRMATION.getValue())) {
            repairStatusType = OpRepairStatusType.WAITING_CONFIRMATION;
        } else if(value.equals(OpRepairStatusType.WAITING_CONFIRMATION_2.getValue())) {
            repairStatusType = OpRepairStatusType.WAITING_CONFIRMATION_2;
        } else if(value.equals(OpRepairStatusType.DOUBLE_CHECK_FAILED.getValue())) {
            repairStatusType = OpRepairStatusType.DOUBLE_CHECK_FAILED;
        } else if(value.equals(OpRepairStatusType.DOUBLE_CHECK_APPEAL.getValue())) {
            repairStatusType = OpRepairStatusType.DOUBLE_CHECK_APPEAL;
        }  else if(value.equals(OpRepairStatusType.REPAIR_COMPLETE.getValue())) {
            repairStatusType = OpRepairStatusType.REPAIR_COMPLETE;
        }

        return repairStatusType;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


}
